package util

import "github.com/shopspring/decimal"

func GetMoneyInFloat(i int32) float64 {
	d := decimal.New(1, 2)
	f, _ := decimal.NewFromInt(int64(i)).DivRound(d, 2).Float64()
	return f
}

func GetMoneyInCent(f float64) int32 {
	d := decimal.New(1, 2)
	return int32(decimal.NewFromFloat(f).Mul(d).IntPart())
}
